#include<stdio.h>

int main()
{
    int num, a, b, c, i=1;
    char m, n;
    while(scanf("%d%c%d%c%d",&a,&m,&b,&n,&c)!=EOF){
        int tag = 0;
        for(num=10; num<=100; num++){
            if(num%3==a && num%5==b && num%7==c){
                tag = num;
            }
        }
        if(tag)
            printf("Case %d : %d\n", i, tag);
        else
            printf("Case %d : %s\n", i, "No answer");
        i++;
        getchar();
    }
    return 0;
}
